package com.fen.demo009;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.ClassPathResource;

/**
 * @author : lrf
 * @description :
 * @tip :
 * @date : 2019/3/22
 */
public class App {

    public static void main(String[] args) {
//        ApplicationContext context = new ClassPathXmlApplicationContext("demo009/parent-context.xml");



//        GenericXmlApplicationContext context = new GenericXmlApplicationContext();
//        context.load("classpath:demo009/parent-context.xml");
//        context.refresh();

        DefaultListableBeanFactory context = new DefaultListableBeanFactory();
        XmlBeanDefinitionReader xdr = new XmlBeanDefinitionReader(context);
        xdr.loadBeanDefinitions(new ClassPathResource("demo009/application.xml"));




        PersonDao personDao = context.getBean("personDao", PersonDao.class);
        personDao.say();

    }
}
